package com.mall.pay.dto.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author xrj
 * @since 2022-05-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TbPayment extends Model<TbPayment> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 支付状态
     */
    @TableField("status")
    private String status;

    /**
     * 订单id
     */
    @TableField("order_id")
    private String orderId;

    /**
     * 产品名称
     */
    @TableField("product_name")
    private String productName;

    /**
     * 第三方返回单号
     */
    @TableField("pay_no")
    private String payNo;

    /**
     * 支付流水号
     */
    @TableField("trade_no")
    private String tradeNo;

    /**
     * 付款人id
     */
    @TableField("payer_uid")
    private Integer payerUid;

    /**
     * 付款人姓名
     */
    @TableField("payer_name")
    private String payerName;

    /**
     * 付款方支付金额
     */
    @TableField("payer_amount")
    private BigDecimal payerAmount;

    /**
     * 订单金额
     */
    @TableField("order_amount")
    private BigDecimal orderAmount;

    /**
     * 支付方式
     */
    @TableField("pay_way")
    private String payWay;

    /**
     * 支付成功时间
     */
    @TableField("pay_success_time")
    private LocalDateTime paySuccessTime;

    /**
     * 支付完成时间
     */
    @TableField("complete_time")
    private LocalDateTime completeTime;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
